<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Routing\Router;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return redirect('/admin');
});

Route::group(['prefix' => 'qw', 'namespace' => 'App\\Http\\Controllers'], function (Router $router) {
    $router->group(['middleware' => 'qw.auth:inventory'], function ($router) {
        $router->get('inventory/index', 'Inventory\InventoryController@index');
        $router->get('inventory/search', 'Inventory\InventoryController@search');
    });

    $router->resource('staff', 'User\StaffController')->middleware('qw.auth:oa_user');
});
